Fall 2025 Math 147: Midterm Exam I — Solutions

When applicable, show all work to receive full credit. When in doubt, it is better to show more work than less. Each problem is worth 25 points.

Please work each problem on a separate sheet of paper, using the reverse side if necessary. Be sure to put your name on each page of your solutions. Good luck on the exam!

Problem 1

1. Let \(f : \mathbb{R}^n \to \mathbb{R}\) be a function of several variables.

  1. (i) When \(n = 2\), define what it means for the partial derivative of \(f(x,y)\) with respect to \(x\) to exist at \((a,b)\).
  2. (ii) Define what it means for the partial derivative of \(f(x_1, \ldots, x_n)\) with respect to \(x_i\) to exist at \(P = (a_1, \ldots, a_n)\).
  3. (iii) Find the absolute maximum and absolute minimum values of the function \(f(x,y) = 5-(x^2+y^2)\) over the region \(D: = \{(x,y)\ |\ 1\leq x^2+y^2\leq 9\}\). Hint: To calculate or not to calculate, that is the question.

Solution. (i) The partial derivative of \(f(x,y)\) with respect to \(x\) exists at \((a,b)\) if \(\lim_{h\to 0}\frac{f(a+h,b)-f(a,b)}{h}\) exists. This value is then \(\pdv{f}{x}\)\((a,b)\).

(ii) The partial derivative of \(f(x_1, \ldots, x_n)\) with respect to \(x_i\) exists at \(P = (a_1, \ldots, a_n)\) if the limit

\[ \lim_{h\to 0}\frac{f(a_1, \ldots, a_i+h,\ldots, a_n)-f(a_1, \ldots, a_i, \ldots, a_n)}{h} \]
exists. This value is then \(\pdv{f}{x_i}\)\((P)\).

(iii) The value of \(x^2+y^2\) on \(D\) increases from 1 to 9, so the value of \(f(x,y)\) on \(D\) decreases from 4 to -4. That is, the absolute minimum value is -4 and the absolute maximum value is 4.

Problem 2

2. On this problem, you need to calculate carefully as your answer in the later parts may depend on what you have calculated in the earlier parts. For the function \(f(x,y) = \begin{cases} \frac{x^3y^2 +xy}{x^2+y^2},\ \textrm{if} \ (x,y) \not = (0,0)\\0,\ \textrm{if}\ (x,y) = (0,0)\end{cases}\)

  1. (i) Determine if \(f(x,y)\) is continuous at (0,0).
  2. (ii) Find formulas for \(f_x(x,y)\) and \(f_y(x,y)\) valid for all \((x,y)\) in \(\mathbb{R}^2\).
  3. (iii) Determine if \(f(x,y)\) is differentiable at (0,0).
  4. (iv) Determine if \(f_x(x,y)\) and \(f_y(x,y)\) are continuous at (0,0) and explain the relevance of this to your answer in part (iii).
  5. (v) Determine if \(f_{xy}(0,0) = f_{yx}(0,0)\).

Solution. This is an unusual function since most of the limits don't exist.

(i) \(\lim_{(x,y)\to (0,0)} f(x,y) = \lim_{r\to 0}\frac{r^5\cos^3\theta\sin^2\theta+r^2\cos\theta\sin\theta}{r^2} = \lim_{r\to 0} r^3\cos^3\theta\sin^2\theta+\cos\theta\sin\theta = \cos\theta\sin\theta\), so the limit does not exits (it depends upon \(\theta\)). Thus, \(f(x,y)\) is not continuous at (0,0).

(ii) We first calculate \(\pdv{f}{x}\)\((0,0)\) and \(\pdv{f}{y}\)\((0,0)\).

\[ \pdv{f}{x}\ (0,0) = \lim_{h\to 0}\frac{(0+h)^30^2+(0+h)y - (0+0)}{h} = \lim_{h\to 0}\frac{0}{h} = 0. \]
Similarly, \(\pdv(f){y}\)\((0,0) = 0\). For points different from the origin, we can just differentiate \(\frac{x^3y^2+xy}{x^2+y^2}\) with respect to \(x\) and \(y\). Thus, we get
\[ \pdv{f}{x}\ (x,y) = \begin{cases} \frac{x^4y^2-x^2y+3x^2y^4+y^3}{(x^2+y^2)^2},\ \textrm{if} \ (x,y) \not = (0,0)\\0,\ \textrm{if}\ (x,y) = (0,0)\end{cases} \]
and
\[ \pdv{f}{y}\ (x,y) = \begin{cases} \frac{2x^5+x^2-xy^2}{(x^2+y^2)^2},\ \textrm{if} \ (x,y) \not = (0,0)\\0,\ \textrm{if}\ (x,y) = (0,0)\end{cases}. \]

(iii) Since \(f(0,0) = f_x(0,0) = f_y(0,0) = 0\), we get \(L(x,y) = 0\) as the approximating linear function. \(f(x,y)\) is differentiable at (0,0) if \(\lim_{(x,y)\to (0,0)} \frac{f(x,y)-L(x,y)}{\sqrt{x^2+y^2}} = 0\). In this case, the limit becomes

\[ \lim_{(x,y)\to (0,0)} \frac{\frac{x^3y^2+xy}{x^2+y^2} - 0}{\sqrt{x^2+y^2}} = \lim_{(x,y)\to (0,0)} \frac{x^3y^2+xy}{(x^2+y^2)^{\frac{3}{2}}} = \lim_{r\to 0} \frac{r^5\cos^3\theta\sin^2\theta + r^2\cos\theta\sin\theta}{r^3} = \lim_{r\to 0} r^2\cos^3\theta\sin^2\theta +\frac{1}{r}\cos\theta\sin\theta, \]
which does not exist. Thus, \(f(x,y)\) is not differentiable at (0,0).

(iv) Trigonometric substitution into the non-zero expressions for \(f_x(x,y)\) and \(f_y(x,y)\) in part (ii) shows that neither \(\lim_{(x,y)\to (0,0)} f_x(x,y)\) nor \(\lim_{(x,y)\to (0,0)} f_y(x,y)\) exist, so that neither of these functions is continuous at \((0,0)\). Since \(f(x,y)\) is not differentiable at (0,0), we know from a theorem in class that at least one of the first order partials of \(f(x,y)\) is not continuous at (0,0). This part of the problem confirms this.

(v) Neither \(f_{xy}(x,y)\) nor \(f_{yx}(x,y)\) exist at (0,0). To see this, using part (ii) we have

\[ f_{xy}\ (0,0) = \lim_{h\to 0}\frac{ f_x(0,0+h)-f_x(0,0)}{h} = \lim_{h\to 0}\frac{\frac{0+(0+h^3)-0}{h^4}}{h} = \lim_{h\to 0}\frac{1}{h^2} \]
and
\[ f_{yx}\ (0,0) = \lim_{h\to 0} \frac{f_y(0+h,0)-f_y(0,0)}{h} = \lim_{h\to 0} \frac{\frac{2h^5+h^2}{h^4}-0}{h} = \lim_{h\to 0} 2+ \frac{1}{h^3}, \]
and neither of these limits exist.

3. For the function \(f(x,y) = \begin{cases} \frac{x^3}{x^2+y^2}, \ \textrm{if}\ (x,y) = (0,0)\\ 0,\ \textrm{if}\ (x,y) = (0,0) \end{cases}\)

  1. (i) Use the limit definition to calculate the directional \(D_{\vec{u}}f (0,0)\) for all directions \(\vec{u} = (u_1, u_2)\).
  2. (ii) Use the limit definition to show that \(f(x,y)\) is not differentiable at \((0,0)\).

Solution. Here one can either state that \(\vec{u}\) is a unit vector, or set \(\vec{v} = (v_1, v_2)\), where \(v_1 = \frac{u_1}{\sqrt{u_1^2+u_2^2}}\) and \(v_2 = \frac{v_1}{\sqrt{v_1^2+v_2^2}}\). Then,
\[ D_{\vec{v}}f (0,0) = \lim_{h\to 0} \frac{\frac{(0+hv_1)^3}{(0+hv_1)^2+(0+hv_2)^2}-0}{h} = \lim_{h\to 0} \frac{h^3v_1^3}{h^3v_1^2+h^3v_2^2} = \frac{v_1^3}{v_1^2+v_2^2}. \]

(ii) To see that \(f(x,y)\) is not differentiable at (0,0), we first calculate \(L(x,y)\), and for this we need \(f_x(0,0)\) and \(f_y(0,0)\), and for this, we can use part (i). Taking \(\vec{v} = (1,0)\) we get \(D_{\vec{v}}f(0,0) = f_x(0,0) = 1\) and taking \(\vec{v} = (0,1)\), we get \(D_{\vec{v}}f (0,0) = f_y(0,0) = 0\). Thus, \(L(x,y) = x\). We now have

\[ \begin{align*} \lmz \frac{f(x,y)-L(x,y)}{\sxy} &= \lmz \frac{\frac{x^3}{x^2+y^2}-x}{\sxy}\\ &= \lmz \frac{x^3}{(x^2+y^2)^{\frac{3}{2}}}-\frac{x}{\sxy}\\ &= \lim_{r\to 0} \frac{r^3\cos^3\theta}{r^3}-\frac{r\cos\theta}{r}\\ &= \cos^3\theta-\cos\theta, \end{align*} \]
showing that the limit does not exist. In particular, the limit is not zero, so \(f(x,y)\) is not differentiable at (0,0).

4. True or False. Explain why you chose true or false, either by giving an example or citing the appropriate theorem.

  1. (i) For \(f : \mathbb{R}^2\to \mathbb{R}\), if \(f(x,y)\) is continuous at \((a,b)\), then \(f(x,y)\) is differentiable at \((a,b)\).
  2. (ii) There exists \(f : \mathbb{R}^2\to \mathbb{R}\) such that the first and second order partial derivatives of \(f(x,y)\) are continuous and \(f_x = 2y\) and \(f_y = 2x\).
  3. (iii) When optimizing a continuous function \(f(x,y)\) on the region \(D\), relative maxima, relative minima, and saddle points will only occur at the points where \(f_x(a,b) = f_y(a,b) = 0\).
  4. (iv) The plane tangent to the graph of \(f(x,y) = 2x^2+3y^2+10\) at (0,0) is parallel to the \(xy\)-plane.
  5. (v) If the directional derivative of \(f(x,y)\) exists in all directions at \((a,b)\), then \(f(x,y)\) is differentiable at \((a,b)\).

  6. (v) Let \(T : \mathbb{R}^n \to \mathbb{R}^n\) satisfy \(T(v) = -v\), for all \(v\in \mathbb{R}^n\). Then \(T\) is a linear transformation.

Solution. (i) False. One can just take the standard example from Calculus I, namely, \(f(x,y) = |x|\).

(ii) True. For example, take \(f(x,y) =2 xy\).

(iii) False. Critical points can occur at places where \(f_x(x,y)\) or \(f_y(x,y)\) are undefined.

(iv) True, since the equation of this plane is \(z = 10\).

(v) False, as exhibited by the function in problem 3.

Problem 5

5. Find the dimensions of the rectangular box with largest volume, whose faces are parallel to the coordinate planes, that can be inscribed in the tetrahedron that has three faces in the coordinate planes and its fourth face in the plane with equation \(15x + 10y + 6z = 30\).

\[ pic1.png \]

Solution. The volume of the box is \(xyz\) and \(z = 5-\ca x- \cb y\), so that
\[V(x,y) = xy(5-\ca x-\cb y) = 5xy - \ca x^2y-\cb xy^2. \]
This leads to
\[ \begin{align*} V_x(x,y) & = 5y -5 xy -\cb y^2 = 0\\ V_y(x,y) &= 5x-\ca x^2-\frac{10}{3} xy = 0. \end{align*} \]
Since neither \(x\) nor \(y\) can be zero, we divide the first equation above by \(5y\) and the second equation above by \(5x\), to obtain
\[ \begin{align*} 1 - x -\bb y &= 0\\ 1-\aaa x-\frac{2}{3} y &= 0. \end{align*} \]
Subtracting the second of these last two equations from the first gives, \(-\aaa x+\bb y = 0\). Solving for \(y\) in terms of \(x\), we have \(y = \ba x\). Substituting into the first of the two equations above gives, \(1-x-\bb (\ba x) = 0\), from which we infer, \(x = \frac{2}{3}\). Thus, \(y = \ba\cdot \frac{2}{3} = 1\). Note that, \((\frac{2}{3},1)\) is the only critical point of \(V(x,y)\) we have to consider. Substituing these values into the equation for \(z\) above yields
\[ z = 5-\ca \cdot \frac{2}{3} -\cb\cdot 1 = \frac{5}{3}. \]
Thus, we obtain a box whose dimensions are \(\frac{2}{3}\times 1\times \frac{5}{3}\). To see that these dimensions give a maximum volume, we use the second derivative test. \(V_{xx} = -5y\), \(V_{yy} = -\frac{10}{3}x\), and \(V_{xy} = 5-5x-\frac{10}{3}y\). Thus, \(V_{xx}(\frac{2}{3},1) = -5\), \(V_{yy}(\frac{2}{3},1) = -\frac{20}{9}\), and \(V_{xy}(\frac{2}{3},1) = 5-\frac{10}{3}-\frac{10}{3} = -\frac{5}{3}\). Therefore, \(D(\frac{2}{3},1) = -5\cdot (-\frac{20}{9}) - (-\frac{5}{3})^2 = \frac{75}{9} > 0.\) Since \(V_{xx}(\frac{2}{3},1) < 0\), the second derivative test tells us the dimensions given above yeild a box of maximum volume.

6. Short Answer :

  1. (i) For \(F(x,y,z) = (3x^2+y^3, 4xyz)\), find \(DF(1,0,2)\), the derivative of \(F(x,y,z)\) at (1,0,2).
  2. (ii) If \(f(x,y) = \cos(x^2+3xy)\), and \(x = 2u^2v, y = 3uv^2\), find a formula for \(\pdv{f}{u}\) in terms of \(u\) and \(v\).
  3. (iii) Find the directional derivative of \(f(x,y,z) = 3x^2y^3 + z^4\) at \((1,2,3)\) in the direction of the vector (1,1,1).
  4. (iv) Explain how properties of the quadratic function \(Q(x,y) = ax^2+bxy+cy^2\) gives insight into why the second derivative test for \(f(x,y)\) classifies a critical point (0,0). You may assume \(f(x,y)\) has a good quadratic approximation at (0,0).
  5. (v) Given \(f(x,y)\), what condition guarantees that \(f_{xy}(a,b) = f_{yx}(a,b)\)?

Solution. (i) \(DF(1,0,2) = \begin{pmatrix} 6 & 0 & 0\\0 & 8 & 0\end{pmatrix}\).

(ii) Since \(f_u = f_x\cdot x_u+f_y\cdot y_u\), we have

\[ \begin{align*} \pdv{f}{u} &= -(2x+3y)\sin(x^2+3xy)4uv- 3x\sin(x^2+3xy)3v^2\\ &= -(4u^2v+9uv^2)\sin(4u^4v^2+18u^3v^3) 4uv-6u^2v\sin(4u^4v^2+18u^3v^3) 3v^2. \end{align*} \]

Since \(f_v = f_x\cdot x_v+f_y\cdot y_v\), we have

\[ \begin{align*} \pdv{f}{v} &= -(2x+3y)\sin(x^2+3xy)\cdot 2u^2-3x\sin(x^2+3xy)\cdot 6uv\\ &= -(4u^2+9uv^2)\sin(4u^4v^2+18u^3v^3)2u^2-6u^2v\sin(4u^4v^2+18u^3v^3)6uv. \end{align*} \]

(iii) We have \(D_{\vec{u}}f(1,2,3) = \nabla f (1,2,3)\cdot \vec{u}\), where \(u = \frac{1}{\sqrt{3}}(1,1,1)\). Since \(\nabla f (1,2,3) = (48, 36, 108)\), we have

\[ D_{\vec{u}}f (1,2,3) = \frac{1}{\sqrt{3}}\cdot (48+36+108) = \frac{192}{\sqrt{3}}. \]

(iv) There was a typo in the statement, so no one lost any points for this part. The quadratic function \(Q(x,y)\) should be \(ax^2+2bxy+cy^2\). Since \(Q(x,y)\) is a good quadratic approximation to \(f(x,y)\) at (0,0), we can analyze \(Q(x,y)\). Then we have \(Q_{xx}(0,0) = 2a, Q_{xy}(0,0) = 2b, Q_{yy}(0,0) = 2c\). Thus, by the second derivative test, if \(4ac-4b^2 >0\), i.e., \(ac-b^2 > 0\), then \(Q(0,0)\) will be a relative maximum or minimum. However, completing the square on \(Q(x,y)\) gives \(Q(x,y) = a(x+\frac{b}{x}y)^2 +(\frac{ac-b^2}{a})y^2\). Thus, if \(ac-b^2 > 0\), \(Q(x,y) > 0\) when \(a > 0\) and \(Q(x,y) < 0\) when \(a < 0\), i.e., \(Q(0,0)\), and hence \(f(0,0)\), is a relative minimum when \(a > 0\) and \(Q(0,0)\), and hence \(f(0,0)\) is a relative maximum when \(a < 0\).

(v) If the first and second order partial derivatives of \(f(x,y)\) are continuous in an open disk \(D\) about \((a,b)\), then \(f_{xy}(a,b) = f_{yx}(a,b)\). In fact, \(f_{xy}(c,d) = f_{yx}(c,d)\), for all \((c,d)\in D\).

Optional Bonus Problems. 1. Find and verify a formula for \(\nabla (\frac{f}{g})\), in terms of the gradients of \(f\) and \(g\). (10 points)

Solution.
\[ \begin{align*} \nabla (\frac{f}{g})& = \frac{gf_x-fg_x}{g^2}\cdot \vec{i} + \frac{gf_y-fg_y}{g^2}\cdot \vec{j} + \frac{gf_z-fg_z}{g^2}\cdot \vec{k}\\ &= \frac{g\nabla f-f\nabla g}{g^2}\\ &= \frac{1}{g}\nabla f - \frac{f}{g^2}\nabla g. \end{align*} \]

2. Let \(S\) denote the paraboloid give by the equation \(z = f(x,y) = x^2+y^2\). Let \(C\) denote the curve on \(S\) obtained by substituting the points on the line \(y = 2x+3\) into the equation of the paraboloid. In other words, \(C\) consists of the points on \(S\) lying above the line \(y = 2x+3\). Find the equation of the line tangent to \(C\) at the point \((1, 5, 26)\). (10 points)

Solution. There is more than one way to solve this problem. The first method is to find the tangent plane and then find the line in the plane lying over \(y = 2x+3\). It is easy to check that the plane tangent to the graph of \(f(x,y)\) at (1,5,26) is the plane \(z = 2(x-1)+10(y-5)+26 = 2x+10y-26\). Since \(y = 2x+3\), substituting into the equation of the plane we get \(z = 2x + 10(2x+3)-26 = 22x+4\). Thus, using the parameter \(t\), we have \(L(t) = (t, 2t+3, 22t+4)\) gives the required tangent line.

For the second method, we first find the parametric equation of the line \(y = 2x+3\) in the \(xy\)-plane. Two points on the line are (1,5) and (0,3) and their difference (1,2) is a direction vector for the line, thus, \(C_0(t) = (1,5)+t(1,2) = (1+t, 5+2t)\) describes the line. Therefore the curve on the surface is give by \(C(t) = (1+t, 5+2t, (1+t)^2+(5+2t)^2)\). Note that \(C(0) = (1, 5, 26)\) so that \(C'(0)\) is the tangent vector to the curve at (1,5, 26). Since \(C'(t) = (1,2, 2(1+t)+2(5+2t)\cdot 2)\), we have \(C'(0) = (1, 2, 22)\). Thus, the tangent line we seek is

\[ L(t) = (1, 5, 26)+t(1, 2, 22) = (1+t, 5+2t, 26+ 22t). \]

Can you see that both methods yield the same line?